package com.lsm.sm.test;

import java.util.HashSet;
import java.util.Set;

public class Hehe {
	
	public static void main(String[] args) {
		Set<Fuck> heh = new HashSet<Fuck>();
		Fuck f1 = new Fuck(1);
		Fuck f2 = new Fuck(2);
		
		heh.add( f1 );
		heh.add( f2 );
		heh.add( f2 );
		heh.add( f1 );
		
		System.out.println( heh.size() );
		
		//f2.i = 1;
		
		System.out.println( heh.size() );
		heh.remove( f1 );
		System.out.println( heh.size() );
		heh.remove( f2 );
		System.out.println( heh.size() );
		
		System.out.println( heh );
		heh.remove( f2 );
		System.out.println( heh );
	}
}

class Fuck{
	public int i;

	public Fuck( int i ){
		this.i = i;
	}
	
	@Override
	public int hashCode() {
		return i;
	}

	@Override
	public boolean equals(Object obj) {
		
		Fuck other = (Fuck) obj;
		
		return i == other.i;
	}
}